<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
namespace Admin\Model;


class TestModel extends SyncModel{
    
    //数据库表名
    protected $tableName = 'test'; 
    
    //leancloud表名
    protected $leancloudName = "Test";
    
    
    //配置字段
    protected $fields = array(
        'objectId', 
        'name', 
        'pid',
        'price',
        '_type'=>array(
            'objectId'=>'varchar',
            'name'=>'varchar', 
            'pid'=>'int',
            'price'=>'double'
        )
    );
    
    //leancloude 字段配置
    //{"objectId":"1337","name":"Sean Plott","pid":{"__type": "Pointer","className": "Product", "objectId": "8"}}
    protected $leancloudelds = array(
        "objectId"=>"String",
        "name"=>"String",
        "pid"=>"Pointer",
        'price'=>"Number"
    );
    
    protected $pointer = array('pid'=>array(
        "__type"=>"Pointer",
        "className"=>"Product", 
        "objectId"=>"pid"
    ));
}

